Application Specification

The following describes all the available fields of an Application:

  1. apiVersion: argoproj.io/v1alpha1
  2. kind: Application
  3. metadata:
  4. name: guestbook
  5. # You'll usually want to add your resources to the argocd namespace.
  6. namespace: argocd
  7. # Add this finalizer ONLY if you want these to cascade delete.
  8. finalizers:
  9. # The default behaviour is foreground cascading deletion
  10. - resources-finalizer.argocd.argoproj.io
  11. # Alternatively, you can use background cascading deletion
  12. # - resources-finalizer.argocd.argoproj.io/background
  13. # Add labels to your application object.
  14. labels:
  15. name: guestbook
  16. spec:
  17. # The project the application belongs to.
  18. project: default
  19. # Source of the application manifests
  20. source:
  21. repoURL: https://github.com/argoproj/argocd-example-apps.git # Can point to either a Helm chart repo or a git repo.
  22. targetRevision: HEAD # For Helm, this refers to the chart version.
  23. path: guestbook # This has no meaning for Helm charts pulled directly from a Helm repo instead of git.
  24. # helm specific config
  25. chart: chart-name # Set this when pulling directly from a Helm repo. DO NOT set for git-hosted Helm charts.
  26. helm:
  27. passCredentials: false # If true then adds --pass-credentials to Helm commands to pass credentials to all domains
  28. # Extra parameters to set (same as setting through values.yaml, but these take precedence)
  29. parameters:
  30. - name: "nginx-ingress.controller.service.annotations.external-dns\\.alpha\\.kubernetes\\.io/hostname"
  31. value: mydomain.example.com
  32. - name: "ingress.annotations.kubernetes\\.io/tls-acme"
  33. value: "true"
  34. forceString: true # ensures that value is treated as a string
  35. # Use the contents of files as parameters (uses Helm's --set-file)
  36. fileParameters:
  37. - name: config
  38. path: files/config.json
  39. # Release name override (defaults to application name)
  40. releaseName: guestbook
  41. # Helm values files for overriding values in the helm chart
  42. # The path is relative to the spec.source.path directory defined above
  43. valueFiles:
  44. - values-prod.yaml
  45. # Ignore locally missing valueFiles when installing Helm chart. Defaults to false
  46. ignoreMissingValueFiles: false
  47. # Values file as block file. Prefer to use valuesObject if possible (see below)
  48. values: |
  49. ingress:
  50. enabled: true
  51. path: /
  52. hosts:
  53. - mydomain.example.com
  54. annotations:
  55. kubernetes.io/ingress.class: nginx
  56. kubernetes.io/tls-acme: "true"
  57. labels: {}
  58. tls:
  59. - secretName: mydomain-tls
  60. hosts:
  61. - mydomain.example.com
  62. # Values file as block file. This takes precedence over values
  63. valuesObject:
  64. ingress:
  65. enabled: true
  66. path: /
  67. hosts:
  68. - mydomain.example.com
  69. annotations:
  70. kubernetes.io/ingress.class: nginx
  71. kubernetes.io/tls-acme: "true"
  72. labels: {}
  73. tls:
  74. - secretName: mydomain-tls
  75. hosts:
  76. - mydomain.example.com
  77. # Skip custom resource definition installation if chart contains custom resource definitions. Defaults to false
  78. skipCrds: false
  79. # Optional Helm version to template with. If omitted it will fall back to look at the 'apiVersion' in Chart.yaml
  80. # and decide which Helm binary to use automatically. This field can be either 'v2' or 'v3'.
  81. version: v2
  82. # kustomize specific config
  83. kustomize:
  84. # Optional kustomize version. Note: version must be configured in argocd-cm ConfigMap
  85. version: v3.5.4
  86. # Supported kustomize transformers. https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/
  87. namePrefix: prod-
  88. nameSuffix: -some-suffix
  89. commonLabels:
  90. foo: bar
  91. commonAnnotations:
  92. beep: boop-${ARGOCD_APP_REVISION}
  93. # Toggle which enables/disables env variables substitution in commonAnnotations
  94. commonAnnotationsEnvsubst: true
  95. images:
  96. - gcr.io/heptio-images/ks-guestbook-demo:0.2
  97. - my-app=gcr.io/my-repo/my-app:0.1
  98. namespace: custom-namespace
  99. replicas:
  100. - name: kustomize-guestbook-ui
  101. count: 4
  102. # directory
  103. directory:
  104. recurse: true
  105. jsonnet:
  106. # A list of Jsonnet External Variables
  107. extVars:
  108. - name: foo
  109. value: bar
  110. # You can use "code to determine if the value is either string (false, the default) or Jsonnet code (if code is true).
  111. - code: true
  112. name: baz
  113. value: "true"
  114. # A list of Jsonnet Top-level Arguments
  115. tlas:
  116. - code: false
  117. name: foo
  118. value: bar
  119. # Exclude contains a glob pattern to match paths against that should be explicitly excluded from being used during
  120. # manifest generation. This takes precedence over the `include` field.
  121. # To match multiple patterns, wrap the patterns in {} and separate them with commas. For example: '{config.yaml,env-use2/*}'
  122. exclude: 'config.yaml'
  123. # Include contains a glob pattern to match paths against that should be explicitly included during manifest
  124. # generation. If this field is set, only matching manifests will be included.
  125. # To match multiple patterns, wrap the patterns in {} and separate them with commas. For example: '{*.yml,*.yaml}'
  126. include: '*.yaml'
  127. # plugin specific config
  128. plugin:
  129. # If the plugin is defined as a sidecar and name is not passed, the plugin will be automatically matched with the
  130. # Application according to the plugin's discovery rules.
  131. name: mypluginname
  132. # environment variables passed to the plugin
  133. env:
  134. - name: FOO
  135. value: bar
  136. # Plugin parameters are new in v2.5.
  137. parameters:
  138. - name: string-param
  139. string: example-string
  140. - name: array-param
  141. array: [item1, item2]
  142. - name: map-param
  143. map:
  144. param-name: param-value
  145. # Sources field specifies the list of sources for the application
  146. sources:
  147. - repoURL: https://github.com/argoproj/argocd-example-apps.git # Can point to either a Helm chart repo or a git repo.
  148. targetRevision: HEAD # For Helm, this refers to the chart version.
  149. path: guestbook # This has no meaning for Helm charts pulled directly from a Helm repo instead of git.
  150. ref: my-repo # For Helm, acts as a reference to this source for fetching values files from this source. Has no meaning when under `source` field
  151. # Destination cluster and namespace to deploy the application
  152. destination:
  153. # cluster API URL
  154. server: https://kubernetes.default.svc
  155. # or cluster name
  156. # name: in-cluster
  157. # The namespace will only be set for namespace-scoped resources that have not set a value for .metadata.namespace
  158. namespace: guestbook
  159. # Extra information to show in the Argo CD Application details tab
  160. info:
  161. - name: 'Example:'
  162. value: 'https://example.com'
  163. # Sync policy
  164. syncPolicy:
  165. automated: # automated sync by default retries failed attempts 5 times with following delays between attempts ( 5s, 10s, 20s, 40s, 80s ); retry controlled using `retry` field.
  166. prune: true # Specifies if resources should be pruned during auto-syncing ( false by default ).
  167. selfHeal: true # Specifies if partial app sync should be executed when resources are changed only in target Kubernetes cluster and no git change detected ( false by default ).
  168. allowEmpty: false # Allows deleting all application resources during automatic syncing ( false by default ).
  169. syncOptions: # Sync options which modifies sync behavior
  170. - Validate=false # disables resource validation (equivalent to 'kubectl apply --validate=false') ( true by default ).
  171. - CreateNamespace=true # Namespace Auto-Creation ensures that namespace specified as the application destination exists in the destination cluster.
  172. - PrunePropagationPolicy=foreground # Supported policies are background, foreground and orphan.
  173. - PruneLast=true # Allow the ability for resource pruning to happen as a final, implicit wave of a sync operation
  174. - RespectIgnoreDifferences=true # When syncing changes, respect fields ignored by the ignoreDifferences configuration
  175. managedNamespaceMetadata: # Sets the metadata for the application namespace. Only valid if CreateNamespace=true (see above), otherwise it's a no-op.
  176. labels: # The labels to set on the application namespace
  177. any: label
  178. you: like
  179. annotations: # The annotations to set on the application namespace
  180. the: same
  181. applies: for
  182. annotations: on-the-namespace
  183. # The retry feature is available since v1.7
  184. retry:
  185. limit: 5 # number of failed sync attempt retries; unlimited number of attempts if less than 0
  186. backoff:
  187. duration: 5s # the amount to back off. Default unit is seconds, but could also be a duration (e.g. "2m", "1h")
  188. factor: 2 # a factor to multiply the base duration after each failed retry
  189. maxDuration: 3m # the maximum amount of time allowed for the backoff strategy
  190. # Will ignore differences between live and desired states during the diff. Note that these configurations are not
  191. # used during the sync process unless the `RespectIgnoreDifferences=true` sync option is enabled.
  192. ignoreDifferences:
  193. # for the specified json pointers
  194. - group: apps
  195. kind: Deployment
  196. jsonPointers:
  197. - /spec/replicas
  198. - kind: ConfigMap
  199. jqPathExpressions:
  200. - '.data["config.yaml"].auth'
  201. # for the specified managedFields managers
  202. - group: "*"
  203. kind: "*"
  204. managedFieldsManagers:
  205. - kube-controller-manager
  206. # Name and namespace are optional. If specified, they must match exactly, these are not glob patterns.
  207. name: my-deployment
  208. namespace: my-namespace
  209. # RevisionHistoryLimit limits the number of items kept in the application's revision history, which is used for
  210. # informational purposes as well as for rollbacks to previous versions. This should only be changed in exceptional
  211. # circumstances. Setting to zero will store no history. This will reduce storage used. Increasing will increase the
  212. # space used to store the history, so we do not recommend increasing it.
  213. revisionHistoryLimit: 10